<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simCheckCollisionEx</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1><a href="../apiOverview.htm">Regular API</a> function</h1>
<h3 class=subsectionBar><a name="simCheckCollisionEx" id="simCheckCollisionEx"></a>simCheckCollisionEx / sim.checkCollisionEx </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Checks whether two entities are colliding. This is the extended functionality version of <a href="simCheckCollision.htm">sim.checkCollision</a>, and will return all intersections between the two entities. Detection is silent (no visual feedback) compared to <a href="simHandleCollision.htm">sim.handleCollision</a>. Also, the collidable flags of the entities are overridden if the entities are objects. See also <a href="simReadCollision.htm">sim.readCollision</a>.<br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simCheckCollisionEx(simInt entity1Handle,simInt entity2Handle,simFloat** intersectionSegments)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>entity1Handle</strong>: handle of entity 1 (can be an object handle or a collection handle)</div>
<div><strong>entity2Handle</strong>: handle of entity 2 (can be an object handle or a collection handle), or sim_handle_all to check entity1 against all other collidable objects<br>
</div>
<div><strong>intersectionSegments</strong>: pointer to an array of simFloat values that represent the intersections (segments) between the two entities (pt1(x,y,z), pt2(x,y,z), pt1(x,y,z), etc). This can be nullptr. The user should use <a href="simReleaseBuffer.htm">simReleaseBuffer</a> to delete the returned data. That data is only valid if return value is &gt;0<br>
</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 in case of an error, otherwise the number of segments returned<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>number result,table intersections=sim.checkCollisionEx(number entity1Handle,number entity2Handle)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam><div><strong>entity1Handle</strong>: handle of entity 1 (can be an object handle or a collection handle)</div>
<div><strong>entity2Handle</strong>: handle of entity 2 (can be an object handle or a collection handle), or sim.handle_all to check entity1 against all other collidable objects<br>
</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div><strong>result</strong>: the number of segments returned</div>
<div><strong>intersections</strong>: a table that contains the intersection segments between the two entities.</div>
</td> 
</tr> 
</table> 

<br>
<p><a href="../apiFunctions.htm">All regular API functions on one page</a></p>
<br>
<br>
</td>
</tr>
</table>
</div>
</body>
</html>
